<template id="nav">
  <fieldset>
    <div id="center" :class="[border, margin]">
      品牌名称：<input
        type="text"
        placeholder="请输入要搜索的品牌"
        :class="margin"
        v-model="val"
        @input="search()"
      />
    </div>
  </fieldset>
</template>
<style scoped>
.border {
  border: 1px solid rgb(139, 19, 39);
  width: 600px;
  height: 36px;
}
.margin {
  margin-top: 8px;
}
fieldset {
  border: 0;
}
input::-webkit-input-placeholder {
  color: rgb(160, 81, 163);
}
</style>

<script>
export default {
  data() {
    return {
      border: "border",
      margin: "margin",
      val: "",
    };
  },
  methods: {
    search() {
      let val = this.val;
      // console.log(val);
      this.$bus.$emit("search", val);
    },
  },
};
</script>
